
#include <stdio.h>

int main() {
    int ncase, n, i, sum, a;
    printf("Input number of cases: ");
    scanf("%d", &ncase);
    while (ncase--) {
        printf("Input number of integers: ");
        scanf("%d", &n);
        sum = 0;
        for (i = 1; i <= n; i++) {
            printf("Input integer %d: ", i);
            scanf("%d", &a);
            sum = sum + a;
        }
        printf("%d\n", sum);
    }

}